package com.carey.blog.repository;

import java.util.List;

import org.json.JSONObject;

import com.carey.blog.framework.latke.repository.Repository;
import com.carey.blog.framework.latke.repository.RepositoryException;

/**
 * Article-Sign repository.
 * 
 */
public interface ArticleSignRepository extends Repository {

	/**
	 * Gets article-sign relations by the specified sign id.
	 * 
	 * @param signId
	 *            the specified sign id
	 * @return for example
	 * 
	 *         <pre>
	 * [{
	 *         "oId": "",
	 *         "sign_oId": signId,
	 *         "article_oId": ""
	 * }, ....], returns an empty list if not found
	 * </pre>
	 * @throws RepositoryException
	 *             repository exception
	 */
	List<JSONObject> getBySignId(final String signId)
			throws RepositoryException;

	/**
	 * Gets an article-sign relation by the specified article id.
	 * 
	 * @param articleId
	 *            the specified article id
	 * @return for example
	 * 
	 *         <pre>
	 * [{
	 *         "oId": "",
	 *         "article_oId": articleId,
	 *         "sign_oId": ""
	 * }, ....], returns {@code null} if not found
	 * </pre>
	 * @throws RepositoryException
	 *             repository exception
	 */
	JSONObject getByArticleId(final String articleId)
			throws RepositoryException;
}
